//当页面发生滚动时
window.onscroll=function(){
    var scroll_top=document.body.scrollTop||document.documentElement.scrollTop;//获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
    var objHeader=document.querySelector('.header');

    if(scroll_top==0){
        objHeader.className = "header"
    }else if(scroll_top>=0){
        objHeader.className = "header search-index-fixed"
    }
}